<?

//当前类别
$this_type = 'et';



switch($type){
	
	case'edit':		//编辑
		
		//更新
		if($go=='update'){
				$meid = (int)$meid;
				
				
				$subjects = trim($subjects);
				if(!$subjects){
					$error = 1;
					msg_error('抱歉，请输入文章标题！');
				}
				
				$contents = trim($contents);
				if(!$contents){
					$error = 1;
					basic::flash('抱歉，请输入文章内容！');
				}
				
				if($meid<=0){
					$error = 1;
					basic::flash('抱歉，请选择属于菜单！');
				}
			
			if($error!=1){
				$db->query("UPDATE manual_list SET meid='$meid',subjects='$subjects',contents='$contents' WHERE types='$this_type' AND inid='$id'");
				
				basic::flash('恭喜，资料修改成功！',"sys.php?model=admin&action={$action}&type=edit&id=".$id,3);
			}
		}
		
		$mod = $db->rows("SELECT * FROM manual_list WHERE inid='$id'");
		
		$posturl   = "sys.php?model=admin&action={$action}&id={$id}&type=edit&go=update";
		
		$mlist = $db->query("SELECT * FROM menus WHERE types='$this_type' ORDER BY orderby ASC, meid ASC");
		
		//标识状态
		$lscheck   = ($mod['lists']==1)?'checked':'';
		
		$this_file = $this_type.'_post';
	break;
	
	
	
	case'del':		//删除
		
		$db->query("DELETE FROM manual_list WHERE types='$this_type' AND inid='$id'");
		
		basic::flash('恭喜，资料删除成功！',"sys.php?model=admin&action={$action}",3);
	break;
	
	
	
	default:
		$info = $db->limit("SELECT i.*,m.titles FROM manual_list i 
		LEFT JOIN menus m ON m.meid=i.meid 
		WHERE i.types='$this_type'
		ORDER BY inid ASC",$page,15);
		$pager = $info['info'];
		$data_list = $info['query'];
		$pages = multi($pager['nums'],$pager['limit'],$pager['nowpage'],$pager['pages']);
		
		
		
		$this_file = $action;
}

Basic :: setModelFile('head');
Basic :: setModelFile($this_file);
Basic :: setModelFile('bottom');
$tpl->p($this_file);

?>